<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateActInviteRewardLogTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('act_invite_reward_log', function (Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->comment('被奖励用户ID（邀请方）');
            $table->integer('invited_user_id')->comment('被邀请用户ID');
            $table->smallInteger('reward_coin')->comment('奖励金币');
            $table->tinyInteger('reward_type')->comment('类型');
            $table->timestamps();
            $table->tinyInteger('flag')->default(1)->comment('状态：0-无效，1-有效');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('act_invite_reward_log');
    }
}
